home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Commun⁄Network / Telnet 2.5.src.ThinkC / source / macbinary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-11  |  994 b   |  41 lines  |  [TEXT/MPS ]

  1. #pragma options(!align_arrays)    /* BYU 2.4.17 - required for MBHead struct */
  2.  
  3. #define MB_READ        0
  4. #define MB_WRITE    1
  5. #define MB_DISABLE    0x80
  6.  
  7. typedef struct MBHead {        /* MacBinary Header */
  8.     char zero1;
  9.     char nlen;
  10.     char name[63];
  11.     char type[4];
  12.     char creator[4];
  13.     char flags;
  14.     char zero2;
  15.     char location[6];
  16.     char protected;
  17.     char zero3;
  18.     char dflen[4];
  19.     char rflen[4];
  20.     char cdate[4];
  21.     char mdate[4];
  22.  
  23. } MBHead;
  24.  
  25. typedef struct MBFile {
  26.     char name[64];            /* The 'C' version of the name */
  27.     short
  28.         fd,                    /* Current File Descriptor */
  29.         mode,                /* Are we reading or writing */
  30.         vrefnum,            /* The volume reference number */
  31.         binary,                /* MacBinary active ? */
  32.         sector1,            /* Are we at the first sector of the file */
  33.         fork;                /* 0 if we're writing the DF, 1 if were writing the RF */
  34.     long
  35.         bytes,                /* Length of the current fork */
  36.         rlen,                /* Length of Resource Fork (bytes) */
  37.         dlen;                /* Length of Data Fork (bytes) */
  38.     MBHead
  39.         header;                /* the first sector... */
  40. } MBFile;
  41.